package com.ruihu.admin.module.business.tasknode.converter;

import com.ruihu.admin.module.business.tasknode.domain.dto.TaskNodeDTO;
import com.ruihu.admin.module.business.tasknode.domain.dto.TaskNodeFileDTO;
import com.ruihu.admin.module.business.tasknode.domain.entity.TaskNodeEntity;
import com.ruihu.admin.module.business.tasknode.domain.vo.TaskNodeFileVO;
import com.ruihu.admin.module.business.tasknode.domain.vo.TaskNodeVO;

import java.util.ArrayList;
import java.util.List;

public class TaskNodeList {

    public static List<TaskNodeVO> convertDTOToTaskNodeVOList(List<TaskNodeDTO> taskNodeDTOList) {
        List<TaskNodeVO> taskNodeVOList = new ArrayList<>(taskNodeDTOList.size());
        taskNodeDTOList.forEach(taskNodeFileDTO -> taskNodeVOList.add(TaskNodeVO.convertToTaskNodeVO(taskNodeFileDTO)));
        return taskNodeVOList;
    }

    public static List<TaskNodeVO> convertEntityToTaskNodeVOList(List<TaskNodeEntity> taskNodeEntityList) {
        List<TaskNodeVO> taskNodeVOList = new ArrayList<>(taskNodeEntityList.size());
        taskNodeEntityList.forEach(taskNodeFileDTO -> taskNodeVOList.add(TaskNodeVO.convertToTaskNodeVO(taskNodeFileDTO)));
        return taskNodeVOList;
    }

}
